import { request } from '@/utils/request'
// @ts-ignore
import type { PageParams, EmployeeResult, AddEmployee } from '@/types/employees'

//  获取员工列表
export const getEmployeesListApi = (params: PageParams) => {
  return request<EmployeeResult>('/sys/user', 'GET', params)
}

// 删除员工
export const delEmployeeApi = (id: number) => {
  return request(`/sys/user/${id}`, 'DELETE')
}

// 新增员工
export const addEmployeeApi = (data: AddEmployee) => {
  return request('/sys/user', 'POST', data)
}

// 分配角色权限
export const assignRoleApi = (data: { id: string; roleIds: string[] }) => {
  return request(`/sys/user/assignRoles`, 'PUT', data)
}
